package com.maben.server003;

import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

/**
 * cxf发布服务类(这样在访问wsdl时：就可以看到参数了)
 */
public class Server {
    public static void main(String[] args) {
        //创建服务工厂bean
        JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();
        //指定服务接口
        jaxWsServerFactoryBean.setServiceClass(WeatherInterface.class);
        //指定服务实现对象
        jaxWsServerFactoryBean.setServiceBean(new WeatherInterfaceImpl());
        //指定webservice的地址
        jaxWsServerFactoryBean.setAddress("http://localhost:3456/weather");
        //创建webservice服务
        jaxWsServerFactoryBean.create();
        System.out.println("发布server003成功");
    }
}
